package cc.core.pullrefresh.extra;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.widget.LinearLayout;

import com.nineoldandroids.animation.ObjectAnimator;

/**
 * Created by Administrator on 2016/1/26.
 */
public abstract class BaseHeaderLayout extends LinearLayout implements ILayoutBase {
    protected ObjectAnimator rotation;

    public BaseHeaderLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(context, attrs);
    }


    public abstract void setPullToRefresh();

    public abstract void setReleaseToRefresh();

    protected void initDefAnim(View view) {
        rotation = ObjectAnimator.ofFloat(view, "rotation", 90f, 360f + 90f).setDuration(2000);
        rotation.setRepeatCount(Integer.MAX_VALUE);
        rotation.setInterpolator(new LinearInterpolator());
    }

}
